import java.util.Scanner;
public class second{
    public static void main(String[] args) {
     System.out.println("计算器测试：请输入两个数字！");
     System.out.println("请输入第一个数字：");
     Scanner scanner = new Scanner(System.in);
     int a = scanner.nextInt();
     System.out.println("请输入第二个数字：");
     int b = scanner.nextInt();
     System.out.println("请选择你需要的运算（0为加法，1为减法，2为乘法，3为除法）：");
     int c = scanner.nextInt();
        System.out.println("运算结果为：");
     if(c==0)
     {
         int x=sum(a,b);  System.out.println(x);
     }
        if(c==1)
        {
            int y=jian(a,b);  System.out.println(y);
        }
        if(c==2)
        {
            int z=cheng(a,b);  System.out.println(z);
        }
        if(c==3)
        {
            int m=jian(a,b);  System.out.println(m);
        }
    }


public static int sum(int a,int b){
    int result = a+b;
    return result;
}
public static int jian(int a,int b){
        if(a<b) {int c=a; a=b;b=c;}
        int result = a-b;
        return result;
    }
    public static int cheng(int a,int b){
        int result = a*b;
        return result;
    }
    public static int chu(int a,int b){
        if(a<b) {int c=a; a=b;b=c;}
        int result = a/b;
        return result;
    }
}